﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Qas.User
{
    public partial class PriorityForm : Form
    {
        public PriorityForm()
        {
            InitializeComponent();
        }

        private double priority;

        /// <summary>
        /// Текущий приоритет
        /// </summary>
        public double Priority
        {
            get
            {
                return this.priority;
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            // Результат работы окна
            this.DialogResult = DialogResult.Cancel;

            // Закрываемся
            this.Close();
            this.Dispose();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;

            this.priority = this.trckBrPriority.Value;

            this.Close();
            this.Dispose();
        }

        private void trckBrPriority_Scroll(object sender, EventArgs e)
        {
            double value = (Double)(this.trckBrPriority.Value) / 10;
            if (value < 1)
            {
                value = 2 - value;
            }
            this.lblValue.Text = value.ToString();
        }

    }
}
